/*
 * Player.h
 *
 *  Created on: 2011-5-5
 *      Author: Administrator
 */

#ifndef PLAYER_H_
#define PLAYER_H_

#include <FBase.h>
#include "Planet.h"

namespace Galaxy {

class AI;
class PlanetsMap;
class GalaxyThread;

class Player : public Osp::Base::Object{
public:
	Player();
	Player(const Player& player);
	virtual ~Player();

	static Player* CreateNewPlayer();
public:
	Player& operator =(const Player& player);

public:
	static AI* GetAIFromeCode(int aiCode);
	void SetAIPowerBonus(int aiBonusStats);
	static Player* CreateAI(int aiBonusStats, int team);
	void SetAIDelayBeforePlay(int duration);
	static Osp::Base::Collection::ArrayList* GetAccessiblePlanets(Planet* pSource, PlanetsMap* pPlanetsMap);
	void Init(Osp::Base::Collection::HashMap* pAccessiblePlanets);
	static void Init(GalaxyThread* pProgerssReporter, Osp::Base::Collection::ArrayList* pPlayers, PlanetsMap* pPlanetsMap);
	void Play(GalaxyThread* pGalaxy, Osp::Base::Collection::ArrayList* pAllPlanets, long now);

public:
	static const Osp::Graphics::Color color_pink;
	int __force;
	int __defense;
	int __speed;
	int __growing;
	int __team;
	AI* __pAI;
	bool __isAlive;

	//Own
	Osp::Graphics::Color* __pColor;

public:
	long __lastTime;
	long __aiWaitBeforePlay;
	int __aiTick;

	//Own
	Osp::Base::Collection::HashMap* __pAccessiblePlanets;

};

}

#endif /* PLAYER_H_ */
